﻿<phone:PhoneApplicationPage
    x:Class="Social_Celebrities.OnlineShare"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False" IsEnabledChanged="PhoneApplicationPage_IsEnabledChanged" >
    <phone:PhoneApplicationPage.Resources>
      
            <DataTemplate  
                x:Key="tblkcat">
                <TextBlock 
                    Foreground="Gray" 
                    FontSize="40" 
                    FontFamily="Calibri" 
                    FontWeight="Normal" 
                    LineHeight="60" 
                    Loaded="TextBlock_Loaded_1" 
                    Text="{Binding}">                    
                </TextBlock>
            </DataTemplate>
      
        <Style TargetType="ContentControl" 
               x:Key="HintCustomStyle">
            <Setter Property="Foreground" 
                    Value="Gray"/>
        </Style>
    </phone:PhoneApplicationPage.Resources>
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid 
        x:Name="LayoutRoot" 
        Background="{StaticResource bipivot}">         
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="80"/>
        </Grid.RowDefinitions>
        <StackPanel 
            Orientation="Horizontal" 
            Grid.Row="0" 
            Margin="0,10,0,0">
            <Image 
                x:Name="imgLogo" 
                Style="{StaticResource DetailPagePivotTitleImage}" 
                Margin="10,0,0,0"
                />
            <TextBlock 
                x:Name="tblkVideosTitle" 
                Foreground="White" 
                Margin="10,0,0,0" 
                Text="SEARCH SHARED CELEBRITIES" />
        </StackPanel>
        <Grid  Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            
                <StackPanel 
                    x:Name="stk" 
                    Orientation="Horizontal" 
                    Grid.Row="0">               
                    <toolkit:PhoneTextBox 
                        LengthIndicatorVisible="False" 
                        Foreground="Gray" 
                        BorderBrush="Gray" 
                        Width="400" 
                        Height="77" 
                        x:Name="TbSearch" 
                        Hint="Search" 
                        HintStyle="{StaticResource HintCustomStyle}" 
                        Margin="0,08,0,0" 
                        KeyDown="TbSearch_KeyDown">                        
                    </toolkit:PhoneTextBox>
                </StackPanel>
       
            <ListBox 
                x:Name="OnlineList" 
                Grid.Row="1">
            <ListBox.ItemTemplate>
                <DataTemplate>
                        <StackPanel 
                            Orientation="Horizontal" 
                            DataContext="{Binding extra}" 
                            Margin="0,10,0,0" 
                            Height="100">
                            
                            <CheckBox 
                                VerticalAlignment="Top" 
                                Background="LightGray" 
                                Visibility="{Binding Control}" 
                                Height="70" 
                                Width="50" 
                                Tag="{Binding Id}" 
                                Checked="CheckBox_Checked_1" 
                                Unchecked="CheckBox_Unchecked_1">                                
                            </CheckBox>
                            <Image
                                Height="110" 
                                VerticalAlignment="Top" 
                                Width="120"  
                                Source="{Binding ImageUrl}">
                            </Image>
                            <StackPanel  
                                VerticalAlignment="Top" 
                                Orientation="Horizontal" 
                                Width="275" 
                                Height="190">
                                <toolkit:ContextMenuService.ContextMenu>
                                    <toolkit:ContextMenu>
                                        <toolkit:MenuItem 
                                            Header="Rate this Celebrity" 
                                            Click="MenuItem_Click" 
                                            Tag="{Binding Id}">
                                        </toolkit:MenuItem>
                                    </toolkit:ContextMenu>
                                </toolkit:ContextMenuService.ContextMenu>
                                <TextBlock 
                                    FontWeight="Bold" 
                                    x:Name="Tbtitle" 
                                    Text="{Binding Title}" 
                                    Foreground="White" 
                                    Tap="Tbtitle_Tap_1" 
                                    FontSize="24" 
                                    Margin="20,10,0,0">
                                </TextBlock>
                            </StackPanel>
                        </StackPanel>                       
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
            <TextBlock 
                x:Name="notavailable" 
                Text="No Celebrities available" 
                Grid.Row="1" 
                HorizontalAlignment="Center" 
                VerticalAlignment="Center" 
                FontSize="25" 
                TextWrapping="Wrap" 
                Visibility="Collapsed">                
            </TextBlock>
        </Grid>
        <StackPanel x:Name="OnlineShareAd" Grid.Row="2" Orientation="Vertical" Margin="0,0,0,0"/>
    </Grid>
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton 
                IconUri="/Images/appbar.download.rest.png" 
                Text="Import"
                Click="ApplicationBarIconButton_Click_1"/>
           
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem 
                    x:Name="sort" 
                    Text="Sort By Published Date" 
                    Click="sort_Click_1" />
                <shell:ApplicationBarMenuItem 
                    x:Name="sort1" 
                    Text="Sort By Rating" 
                    Click="sort1_Click"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>